
var note = "很多人咖啡馆公示：亲爱的%username%股东，咖啡馆与桌游合作协议已经上传股东群共享，公示两天，2014年1月2日-2014年1月4日，公示期间无疑义则视为同意执行，有疑义请尽量联系沃森。";
var Frr = WebMM.model("contact").getAllFriendContact();
var chkbj;
for (var i in Frr) {
	var Rrr = Frr[i].RemarkName.split('-');
	if(Frr[i].UserName=='fauglobe'){chkbj = Frr[i];}
	if(Rrr[0]=='股东'){
		//if(Rrr[1]=='蔡金凯' || Rrr[1]=='陈婷婷'){sendmsg(Frr[i],note);syncmsg();}
		sendmsg(Frr[i],note);syncmsg();
	}
};
sendmsg(chkbj,note);
function sendmsg(ubj,note){
	var username = ubj.UserName;
	note = note.replace('%username%',ubj.NickName);
	var Awx_now = (new Date()).getTime();
	var Sid = WebMM.model("account").getSid();
var data = {"BaseRequest":{"Uin":WebMM.model("account").getUin(),"Sid":Sid,"Skey":WebMM.model("account").getSkey(),"DeviceID":WebMM.getDeviceId()},"Msg":{"FromUserName":WebMM.model("account").getUserName(),"ToUserName":username,"Type":1,"Content":note,"ClientMsgId":Awx_now,"LocalID":Awx_now}};
	var url = "https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxsendmsg?sid="+encodeURIComponent(Sid)+"&r="+Awx_now;
	jQuery.ajax({
		async:false,
		type: "POST",
		contentType:"application/json; charset=UTF-8",
		url: url,
		data: JSON.stringify(data),
		success: function(msg){
			console.log('send',msg);
		}
	});
}
function syncmsg(){
	var Awx_now = (new Date()).getTime();
	var Sid = WebMM.model("account").getSid();
	var url="https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxsync?sid="+encodeURIComponent(Sid)+"&r="+Awx_now;
	var data = {"BaseRequest":{"Uin":WebMM.model("account").getUin(),"Sid":Sid},"SyncKey":WebMM.model("account").getSyncKey(),"rr":Awx_now};
	jQuery.ajax({
		async:false,
		type: "POST",
		contentType:"application/json; charset=UTF-8",
		url: url,
		data: JSON.stringify(data),
		success: function(msg){
			console.log('sync');
		}
	});
}